<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Immediate Alert Service</title>
<link href="tabs.css" rel="stylesheet" type="text/css" />
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="alias.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="alias.js"></script>

<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>


<script type="text/javascript">
  jQuery(document).ready(function () {
    if(gref){ // Number all _img and _table classes
      gref();
    }
  });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->

<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">nRF51822 BLE SDK
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('group__ble__sdk__srv__ias.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Immediate Alert Service</div>  </div>
<div class="ingroups"><a class="el" href="group__ble__sdk__srv.html">Bluetooth Services</a></div></div>
<div class="contents">

<p>Immediate Alert Service module.  
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structble__ias__evt__t.html">ble_ias_evt_t</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Immediate Alert Service event.  <a href="structble__ias__evt__t.html#details">More...</a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structble__ias__init__t.html">ble_ias_init_t</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Immediate Alert Service init structure. This contains all options and data needed for initialization of the service.  <a href="structble__ias__init__t.html#details">More...</a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structble__ias__s.html">ble_ias_s</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Immediate Alert Service structure. This contains various status information for the service.  <a href="structble__ias__s.html#details">More...</a><br/></td></tr>
<tr><td colspan="2"><h2><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga8a63bc7ea5b311d297838a4095271665"></a><!-- doxytag: member="ble_sdk_srv_ias::ble_ias_t" ref="ga8a63bc7ea5b311d297838a4095271665" args="" -->
typedef struct <a class="el" href="structble__ias__s.html">ble_ias_s</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ble__sdk__srv__ias.html#ga8a63bc7ea5b311d297838a4095271665">ble_ias_t</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Immediate Alert Service structure. This contains various status information for the service. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gab059c5376beb245a8f876ee3d7b8480a"></a><!-- doxytag: member="ble_sdk_srv_ias::ble_ias_evt_handler_t" ref="gab059c5376beb245a8f876ee3d7b8480a" args=")(ble_ias_t *p_ias, ble_ias_evt_t *p_evt)" -->
typedef void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ble__sdk__srv__ias.html#gab059c5376beb245a8f876ee3d7b8480a">ble_ias_evt_handler_t</a> )(<a class="el" href="group__ble__sdk__srv__ias.html#ga8a63bc7ea5b311d297838a4095271665">ble_ias_t</a> *p_ias, <a class="el" href="structble__ias__evt__t.html">ble_ias_evt_t</a> *p_evt)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Immediate Alert Service event handler type. <br/></td></tr>
<tr><td colspan="2"><h2><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ble__sdk__srv__ias.html#gaa55445ca6b845393a2dc353e0afa38ec">ble_ias_evt_type_t</a> { <a class="el" href="group__ble__sdk__srv__ias.html#ggaa55445ca6b845393a2dc353e0afa38ecaf04e8963239be8fd6c09d876f88db8ff">BLE_IAS_EVT_ALERT_LEVEL_UPDATED</a>
 }</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Immediate Alert Service event type.  <a href="group__ble__sdk__srv__ias.html#gaa55445ca6b845393a2dc353e0afa38ec">More...</a><br/></td></tr>
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ble__sdk__srv__ias.html#gaa1d939e0499a5e34f6c9752347f6b974">ble_ias_init</a> (<a class="el" href="group__ble__sdk__srv__ias.html#ga8a63bc7ea5b311d297838a4095271665">ble_ias_t</a> *p_ias, const <a class="el" href="structble__ias__init__t.html">ble_ias_init_t</a> *p_ias_init)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize the Immediate Alert Service.  <a href="#gaa1d939e0499a5e34f6c9752347f6b974"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ble__sdk__srv__ias.html#ga7aceea1ccf7fa036d066a08e19fe1504">ble_ias_on_ble_evt</a> (<a class="el" href="group__ble__sdk__srv__ias.html#ga8a63bc7ea5b311d297838a4095271665">ble_ias_t</a> *p_ias, <a class="el" href="structble__evt__t.html">ble_evt_t</a> *p_ble_evt)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Immediate Alert Service BLE stack event handler.  <a href="#ga7aceea1ccf7fa036d066a08e19fe1504"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ble__sdk__srv__ias.html#ga2b433148292e1fdf6ab22633e2d8dde1">ble_ias_alert_level_get</a> (<a class="el" href="group__ble__sdk__srv__ias.html#ga8a63bc7ea5b311d297838a4095271665">ble_ias_t</a> *p_ias, uint8_t *p_alert_level)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Get current value of the Alert Level characteristic.  <a href="#ga2b433148292e1fdf6ab22633e2d8dde1"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<p>Immediate Alert Service module. </p>
<p>This module implements the Immediate Alert Service with the Alert Level characteristic. During initialization it adds the Immediate Alert Service and Alert Level characteristic to the BLE stack database.</p>
<p>The application must supply an event handler for receiving Immediate Alert Service events. Using this handler, the service will notify the application when the Alert Level characteristic value changes.</p>
<p>The service also provides a function for letting the application poll the current value of the Alert Level characteristic.</p>
<dl class="note"><dt><b>Note:</b></dt><dd>The application must propagate BLE stack events to the Immediate Alert Service module by calling <a class="el" href="group__ble__sdk__srv__ias.html#ga7aceea1ccf7fa036d066a08e19fe1504" title="Immediate Alert Service BLE stack event handler.">ble_ias_on_ble_evt()</a> from the <a class="el" href="group__ble__stack__handler.html">BLE Stack Event Handler</a> callback. </dd></dl>
<hr/><h2>Enumeration Type Documentation</h2>
<a class="anchor" id="gaa55445ca6b845393a2dc353e0afa38ec"></a><!-- doxytag: member="ble_ias.h::ble_ias_evt_type_t" ref="gaa55445ca6b845393a2dc353e0afa38ec" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group__ble__sdk__srv__ias.html#gaa55445ca6b845393a2dc353e0afa38ec">ble_ias_evt_type_t</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Immediate Alert Service event type. </p>
<dl><dt><b>Enumerator: </b></dt><dd><table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><em><a class="anchor" id="ggaa55445ca6b845393a2dc353e0afa38ecaf04e8963239be8fd6c09d876f88db8ff"></a><!-- doxytag: member="BLE_IAS_EVT_ALERT_LEVEL_UPDATED" ref="ggaa55445ca6b845393a2dc353e0afa38ecaf04e8963239be8fd6c09d876f88db8ff" args="" -->BLE_IAS_EVT_ALERT_LEVEL_UPDATED</em>&nbsp;</td><td>
<p>Alert Level Updated event. </p>
</td></tr>
</table>
</dd>
</dl>

<p>Definition at line <a class="el" href="ble__ias_8h_source.html#l00043">43</a> of file <a class="el" href="ble__ias_8h_source.html">ble_ias.h</a>.</p>

</div>
</div>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="gaa1d939e0499a5e34f6c9752347f6b974"></a><!-- doxytag: member="ble_ias.h::ble_ias_init" ref="gaa1d939e0499a5e34f6c9752347f6b974" args="(ble_ias_t *p_ias, const ble_ias_init_t *p_ias_init)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t ble_ias_init </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__ble__sdk__srv__ias.html#ga8a63bc7ea5b311d297838a4095271665">ble_ias_t</a> *&#160;</td>
          <td class="paramname"><em>p_ias</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structble__ias__init__t.html">ble_ias_init_t</a> *&#160;</td>
          <td class="paramname"><em>p_ias_init</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Initialize the Immediate Alert Service. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">p_ias</td><td>Immediate Alert Service structure. This structure will have to be supplied by the application. It will be initialized by this function, and will later be used to identify this particular service instance. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">p_ias_init</td><td>Information needed to initialize the service. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>NRF_SUCCESS on successful initialization of service, otherwise an error code. </dd></dl>

<p>Definition at line <a class="el" href="ble__ias_8c_source.html#l00098">98</a> of file <a class="el" href="ble__ias_8c_source.html">ble_ias.c</a>.</p>

</div>
</div>
<a class="anchor" id="ga7aceea1ccf7fa036d066a08e19fe1504"></a><!-- doxytag: member="ble_ias.h::ble_ias_on_ble_evt" ref="ga7aceea1ccf7fa036d066a08e19fe1504" args="(ble_ias_t *p_ias, ble_evt_t *p_ble_evt)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ble_ias_on_ble_evt </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__ble__sdk__srv__ias.html#ga8a63bc7ea5b311d297838a4095271665">ble_ias_t</a> *&#160;</td>
          <td class="paramname"><em>p_ias</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structble__evt__t.html">ble_evt_t</a> *&#160;</td>
          <td class="paramname"><em>p_ble_evt</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Immediate Alert Service BLE stack event handler. </p>
<p>Handles all events from the BLE stack of interest to the Immediate Alert Service.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">p_ias</td><td>Immediate Alert Service structure. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">p_ble_evt</td><td>Event received from the BLE stack. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="ble__ias_8c_source.html#l00039">39</a> of file <a class="el" href="ble__ias_8c_source.html">ble_ias.c</a>.</p>

</div>
</div>
<a class="anchor" id="ga2b433148292e1fdf6ab22633e2d8dde1"></a><!-- doxytag: member="ble_ias.h::ble_ias_alert_level_get" ref="ga2b433148292e1fdf6ab22633e2d8dde1" args="(ble_ias_t *p_ias, uint8_t *p_alert_level)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t ble_ias_alert_level_get </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__ble__sdk__srv__ias.html#ga8a63bc7ea5b311d297838a4095271665">ble_ias_t</a> *&#160;</td>
          <td class="paramname"><em>p_ias</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>p_alert_level</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Get current value of the Alert Level characteristic. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">p_ias</td><td>Immediate Alert Service structure. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">p_alert_level</td><td>Current Alert Level value. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="ble__ias_8c_source.html#l00124">124</a> of file <a class="el" href="ble__ias_8c_source.html">ble_ias.c</a>.</p>

</div>
</div>
</div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>


    <li class="footer">
      Copyright &copy 2006-2011 <a href="http://www.nordicsemi.no" style="text-decoration:none">Nordic Semiconductor</a>.
      All Rights Reserved.
      <a href="disclaimer.html">Disclaimer</a>
    </li>
   </ul>
 </div>


</body>
</html>
